/**
 * Copyright © 2021-2025 <a href="http://www.jeeplus.org/">JeePlus</a> All rights reserved.
 */
package com.jeeplus.visit.service;

import com.jeeplus.doctor.domain.DoctorInfo;
import com.jeeplus.doctor.service.dto.DoctorInfoDTO;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jeeplus.visit.service.dto.VisitInfoDTO;
import com.jeeplus.visit.domain.VisitInfo;
import com.jeeplus.visit.mapper.VisitInfoMapper;

import java.util.List;

/**
 * 就诊记录Service
 * @author xx
 * @version 2023-12-30
 */
@Service
@Transactional
public class VisitInfoService extends ServiceImpl<VisitInfoMapper, VisitInfo> {

	/**
	 * 根据id查询
	 * @param id
	 * @return
	 */
	public VisitInfoDTO findById(String id) {
		return baseMapper.findById ( id );
	}

	/**
	 * 自定义分页检索
	 * @param page
	 * @param queryWrapper
	 * @return
	 */
	public IPage <VisitInfoDTO> findPage(Page <VisitInfoDTO> page, QueryWrapper queryWrapper) {
		queryWrapper.eq ("a.del_flag", 0 ); // 排除已经删除
		return  baseMapper.findList (page, queryWrapper);
	}

	public List<DoctorInfoDTO> getMyDoctors(String id) {
		return baseMapper.getMyDoctors(id);
	}
}
